package com.franklin.java.action.sql.entity.ui;

import com.google.common.collect.Lists;
import com.intellij.ui.treeStructure.SimpleNode;

import java.util.List;

import static com.flychord.jdk.util.tuple.TupleAble.tuple;

/**
 * @author Franklin
 * @since 2021/9/13 15:30
 */
public class AssociationNode extends ResultMapChildNode{
    private String property;
    private String column;
    private String javaType;
    private String resultMap;

    protected AssociationNode(SimpleNode aParent, String property, String column, String javaType, String resultMap) {
        super(aParent);
        this.property = property;
        this.column = column;
        this.javaType = javaType;
        this.resultMap = resultMap;
        setProperties();
    }

    @Override
    protected void setProperties() {
        this.properties = Lists.newArrayList(
            tuple("property",property),
            tuple("column",column),
            tuple("javaType",javaType),
            tuple("resultMap",resultMap)
        );
    }

    @Override
    public boolean isSingleTag() {
        return false;
    }

}
